package com.ruoyi.eqmonitor.vo;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * 设备类型与监测指标关系实体
 */
public class DeviceMonitorParams implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 设备类型
     */
    private String deviceType;

    /**
     * 设备类型名称
     */
    private String deviceTypeName;

    /**
     * 监测指标
     */
    private List<MonitorParams> monitorParams;

    /**
     * 监测指标实体
     */
    public static class MonitorParams {

        /**
         * 监测指标编码
         */
        private String monitorCode;

        /**
         * 监测指标单位
         */
        private String dataUnit;

        /**
         * 监测指标名称
         */
        private String monitorName;

        public String getMonitorCode() {
            return monitorCode;
        }

        public void setMonitorCode(String monitorCode) {
            this.monitorCode = monitorCode;
        }

        public String getDataUnit() {
            return dataUnit;
        }

        public void setDataUnit(String dataUnit) {
            this.dataUnit = dataUnit;
        }

        public String getMonitorName() {
            return monitorName;
        }

        public void setMonitorName(String monitorName) {
            this.monitorName = monitorName;
        }

        public MonitorParams() {
        }

        public MonitorParams(String monitorCode, String dataUnit, String monitorName) {
            this.monitorCode = monitorCode;
            this.dataUnit = dataUnit;
            this.monitorName = monitorName;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            MonitorParams that = (MonitorParams) o;
            return Objects.equals(monitorCode, that.monitorCode) && Objects.equals(dataUnit, that.dataUnit) && Objects.equals(monitorName, that.monitorName);
        }

        @Override
        public int hashCode() {
            return Objects.hash(monitorCode, dataUnit, monitorName);
        }

        @Override
        public String toString() {
            return "MonitorParams{" +
                    "monitorCode='" + monitorCode + '\'' +
                    ", dataUnit='" + dataUnit + '\'' +
                    ", monitorName='" + monitorName + '\'' +
                    '}';
        }
    }

    public DeviceMonitorParams() {
    }

    public DeviceMonitorParams(String deviceType, String deviceTypeName, List<MonitorParams> monitorParams) {
        this.deviceType = deviceType;
        this.deviceTypeName = deviceTypeName;
        this.monitorParams = monitorParams;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getDeviceTypeName() {
        return deviceTypeName;
    }

    public void setDeviceTypeName(String deviceTypeName) {
        this.deviceTypeName = deviceTypeName;
    }

    public List<MonitorParams> getMonitorParams() {
        return monitorParams;
    }

    public void setMonitorParams(List<MonitorParams> monitorParams) {
        this.monitorParams = monitorParams;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DeviceMonitorParams that = (DeviceMonitorParams) o;
        return Objects.equals(deviceType, that.deviceType) && Objects.equals(deviceTypeName, that.deviceTypeName) && Objects.equals(monitorParams, that.monitorParams);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deviceType, deviceTypeName, monitorParams);
    }

    @Override
    public String toString() {
        return "DeviceMonitorParams{" +
                "deviceType='" + deviceType + '\'' +
                ", deviceTypeName='" + deviceTypeName + '\'' +
                ", monitorParams=" + monitorParams +
                '}';
    }
}
